package com.stb.server.guice;

import com.google.inject.servlet.ServletModule;
import com.stb.client.remote.UserService;
import com.stb.server.UserServiceImpl;
import com.stb.server.dao.UserDAO;
import com.stb.server.dao.UserDAOImpl;
import com.stb.server.mail.MailSender;
import com.stb.server.mail.MailSenderImpl;
import com.stb.server.url.URLEncoder;
import com.stb.server.url.URLEncoderImpl;

public class YaggleModule extends ServletModule {
    @Override
    protected void configureServlets() {
        serve("/yaggle/GWT.rpc").with(GuiceRemoteServiceServlet.class);
        bind(UserService.class).to(UserServiceImpl.class).asEagerSingleton();
        bind(UserDAO.class).to(UserDAOImpl.class).asEagerSingleton();
        bind(MailSender.class).to(MailSenderImpl.class).asEagerSingleton();
        bind(URLEncoder.class).to(URLEncoderImpl.class).asEagerSingleton();
    }
}